// 罗盘
// import * as Cesium from 'cesium'
import { ref } from 'vue'
// const MAP_URL = window.webConfig.MAP_URL
const MAP_URL = localStorage.getItem('MAPURL')
console.log(MAP_URL);
export const compassOptions = ref({
  duration: 3,
  enableCompass: true, //罗盘
  enableZoomControls: true, //缩放http://localhost:666/map/xian/Mapnik/
  enableDistanceLegend: true, //比例尺
  enableCompassOuterRing: true, //翻转
  // resetTooltip: '重置视图',
  zoomInTooltip: '放大',
  zoomOutTooltip: '缩小',
  // defaultResetView: Cesium.Rectangle.fromDegrees(80, 22, 130, 50)
  defaultResetView: new Cesium.Cartographic(Cesium.Math.toRadians(116.5), Cesium.Math.toRadians(39.8997206760441205), 8213979.400955964)
})
export const tokentoken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJiODQzMGFkNi0xOTNkLTQ2OWMtOWVjNS02NWIyOGQ5MmUzNmYiLCJpZCI6OTAzNDksImlhdCI6MTY1MDMzMzIxOH0.sI2TCvX5Bf0EkJkWc0kg0lFdNGnFNqjEI2ceMWRiyWo'

export const viewerOptions = {
  antialias: true,
  shadows: true,
  contextOptions: {
    webgl: {
      alpha: true
    }
  },
  // 不显示底图


  imageryProvider: new Cesium.UrlTemplateImageryProvider({
    url: MAP_URL,
    fileExtension: 'png',
  }),

  // terrainProvider: new Cesium.CesiumTerrainProvider({
  //   url: 'http://localhost:667/map'
  // }),
  // sceneMode: Cesium.SceneMode.COLUMBUS_VIEW,
  // sceneMode: Cesium.SceneMode.SCENE2D,
  geocoder: false, //隐藏查找位置
  // shouldAnimate: false, //时间不动
  homeButton: false, //是否显示回到初始位置
  sceneModePicker: false, //23D切换
  infoBox: false,//信息框
  baseLayerPicker: false, //图层选择
  navigationHelpButton: false, //帮助
  // animation: false, //动画控制
  // timeline: false, //时间轴
  fullscreenButton: false, //全屏
  vrButton: false, //vr
  selectionIndicator: false,
  creditsDisplay: false,
  navigationInstructionsInitiallyVisible: true,
  scene3DOnly: false, //为了节省GPU内存，每个几何实例只会在3D下被渲染。
  targetFrameRate: 60, //设置最大频率数
  resolutionScale: 1, //清晰度 0-1
  maximumRenderTimeChange: Infinity, // 无操作时自动渲染帧率，设为数字会消耗性能，Infinity为无操作不渲染
  useBrowserRecommendedResolution: false, // 是否选择浏览器推荐分辨率
  maximumScreenSpaceError: 64, //屏幕空间最大误差
  terrainShadows: Cesium.ShadowMode.DISABLED, // 地质接收阴影
  // requestRenderMode: true,
  // useBrowserRecommendedResolution: true,
  automaticallyTrackDataSourceClocks: true,
  orderIndependentTranslucency: true
}
// 天空盒
export const sources = {
  // 紫色
  positiveX: '/SkyBox/tycho2t3_80_pxs.jpg',
  negativeX: '/SkyBox/tycho2t3_80_mxs.jpg',
  positiveY: '/SkyBox/tycho2t3_80_pys.jpg',
  negativeY: '/SkyBox/tycho2t3_80_mys.jpg',
  positiveZ: '/SkyBox/tycho2t3_80_pzs.jpg',
  negativeZ: '/SkyBox/tycho2t3_80_mzs.jpg'
}
